package com.sudo.dao.admin.model.bo;

import com.sudo.common.utils.PatternUtil;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author 为道日损 2020-04-27 16:52
 */
@Data
@ToString
public class SysPostEmailCodeBO {
    @NotBlank(message = "邮箱不能为空")
    @Pattern(regexp = PatternUtil.email,message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "用户名不能为空")
    @Length(min = 4, max = 10, message = "用户名必须由4~10个字符组成")
    @Pattern(regexp="[0-9A-Za-z_]{4,10}",message="用户名必须是4~10位数字、字母或下划线")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 10, message = "密码必须由6~10个字符组成")
    @Pattern(regexp="[0-9A-Za-z_]{6,10}",message="密码必须是6~10位数字、字母或下划线")
    private String password;

    @NotBlank(message = "确认密码不能为空")
    @Length(min = 6, max = 10, message = "确认密码必须由6~10个字符组成")
    @Pattern(regexp="[0-9A-Za-z_]{6,10}",message="确认密码必须是6~10位数字、字母或下划线")
    private String confirmPassword;

}
